package com.ruoyi.project.system.record.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.record.mapper.WorkRecordMapper;
import com.ruoyi.project.system.record.domain.WorkRecord;
import com.ruoyi.project.system.record.service.IWorkRecordService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 工作日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2019-11-15
 */
@Service
public class WorkRecordServiceImpl implements IWorkRecordService 
{
    @Autowired
    private WorkRecordMapper workRecordMapper;

    /**
     * 查询工作日志
     * 
     * @param workId 工作日志ID
     * @return 工作日志
     */
    @Override
    public WorkRecord selectWorkRecordById(Long workId)
    {
        return workRecordMapper.selectWorkRecordById(workId);
    }

    /**
     * 查询工作日志列表
     * 
     * @param workRecord 工作日志
     * @return 工作日志
     */
    @Override
    public List<WorkRecord> selectWorkRecordList(WorkRecord workRecord)
    {
        return workRecordMapper.selectWorkRecordList(workRecord);
    }

    /**
     * 新增工作日志
     * 
     * @param workRecord 工作日志
     * @return 结果
     */
    @Override
    public int insertWorkRecord(WorkRecord workRecord)
    {
        return workRecordMapper.insertWorkRecord(workRecord);
    }

    /**
     * 修改工作日志
     * 
     * @param workRecord 工作日志
     * @return 结果
     */
    @Override
    public int updateWorkRecord(WorkRecord workRecord)
    {
        return workRecordMapper.updateWorkRecord(workRecord);
    }

    /**
     * 删除工作日志对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWorkRecordByIds(String ids)
    {
        return workRecordMapper.deleteWorkRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工作日志信息
     * 
     * @param workId 工作日志ID
     * @return 结果
     */
    @Override
    public int deleteWorkRecordById(Long workId)
    {
        return workRecordMapper.deleteWorkRecordById(workId);
    }

    @Override
    public String selectWorkRecordBySj(Long userid){
        return workRecordMapper.selectWorkRecordBySj(userid);
    }
}
